export const SortMixin = {
  data() {
    return {
      sortDownFunc: (id) => {
        return new Promise((resolve, reject) => {})
      },
      sortUpFunc: (id) => {
        return new Promise((resolve, reject) => {})
      },
      sortTopFunc: (id) => {
        return new Promise((resolve, reject) => {})
      },
      sortBottomFunc: (id) => {
        return new Promise((resolve, reject) => {})
      }
    }
  },
  created() {
  },
  methods: {
    sortDown(id) {
      this.sortDownFunc(id).then(data => {
        if (data.code === 0) {
          this.toast('更新成功')
          this.refresh_data(this.currentPage)
        } else {
          this.toast(data.description)
        }
      })
    },
    sortUp(id) {
      this.sortUpFunc(id).then(data => {
        if (data.code === 0) {
          this.toast('更新成功')
          this.refresh_data(this.currentPage)
        } else {
          this.toast(data.description)
        }
      })
    },
    sortTop(id) {
      this.sortTopFunc(id).then(data => {
        if (data.code === 0) {
          this.toast('更新成功')
          this.refresh_data(this.currentPage)
        } else {
          this.toast(data.description)
        }
      })
    },
    sortBottom(id) {
      this.sortBottomFunc(id).then(data => {
        if (data.code === 0) {
          this.toast('更新成功')
          this.refresh_data(this.currentPage)
        } else {
          this.toast(data.description)
        }
      })
    }
  }
}
